/**
 * 
 */
package com.lastct.services.users;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.StringTokenizer;

import javax.naming.NamingException;

import com.lastct.connection.ConnectionUtil;

/**
 * @author Marco DC
 * 
 */
public class loginServices {

	public String login(String loginData) {
		StringTokenizer tokenizer = new StringTokenizer(loginData, ";");
		String result = "Error";
		Connection conn = null;
		try {
			conn = ConnectionUtil.getConnectionDB();
			Statement stmt = conn.createStatement();

		
			String sql = "INSERT INTO users (name, address) "
					+ "VALUES ('Foo Bar', 'Some Street')";

			
			stmt.execute(sql);

			// After this statement is executed you'll have a
			// record in your users table.

		} catch (NamingException | SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			if (conn != null) {
				try {
					conn.close();
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}

		return result;

	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
